#ifndef MAP_GLOBAL_H
#define MAP_GLOBAL_H
#include "common_functions.h"
#include <iostream>

class MapGlobal 
{
public:
    MapGlobal(int width, int height, float gird_size);
    ~MapGlobal();

    void updateCell(int x, int y, unsigned char value);
    unsigned char getCell(int x, int y) const;

    void update(const std::vector<unsigned char>& local_map);

    int getWidth() const;
    int getHeight() const;

    const std::vector<unsigned char>& getMap() const;


private:
    int width_, height_, size_;
    float grid_size_;
    // unsigned char* map_;
    std::vector<unsigned char> map_;
    int min_x_, min_y_;
    int max_x_, max_y_;
    int zero_x_;
    int zero_y_;


    bool isValidCell(int x, int y) const;
};

#endif // MAP_GLOBAL_H
